n=int(input())

gra=[[] for i in range(0,100)]
for i in range(0,100):
    gra[i]=[0 for i in range(0,100)]

for i in range(0,n):
    x1,y1,x2,y2=map(int,input().split())
    for j in range(x1,x2):
        for k in range(y1,y2):
            gra[j][k]=1

result=0
for i in range(0,100):
    for j in range(0,100):
        result+=gra[i][j]

print(result)